package cn.tedu.micro.demo.ws.controller;

import cn.tedu.micro.demo.ws.points.WebsocketFirstServerPoint;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class TalkController {
    @Autowired
    private WebsocketFirstServerPoint websocket;
    @GetMapping("/send/msg")
    public String sendMsg(Integer userId,String msg){
        websocket.sendMsg2User(userId,msg);
        return "success";
    }
}
